<template>
  <el-dialog :visible.sync="$attrs.visableIf" @close="handleCloseDialog" width="30%" append-to-body class="borderb_dia">
    <div slot="title" style="font-size: 14px;font-weight: 500;">
      拉群设置
    </div>
    <el-form :model="form" ref="form" size="small" label-position="top" class="send-setting-form" :inline="true" @submit.native.prevent>
      <el-form-item prop="name">
        <span slot="label">
          <span>对象发送间隔</span>
        </span>
        <div class="form-item-rows">
          <el-input size="small" style="width: 88px;" />
          <span>~</span>
          <el-input size="small" style="width: 88px;" />
          <span>秒</span>
          <el-button size="small" type="primary" plain style="margin-left: 15px;">设置为推荐值</el-button>
        </div>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleCloseDialog">取 消</el-button>
      <el-button type="primary" @click="handleCloseDialog">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      timeRange: [],//时间范围
      value1: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
      form: {
        id: "",
        name: "",
        phone: "",
        email: "",
        status: "",
        password: "",
        type_id: [],
      },
      timeSet: {
        selectableRange: `08:00:00  - 23:59:00`,
        format: ' HH:mm'
      },
      // 表单校验
      rules: {
        name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
        email: [
          {
            required: true,
            type: "email",
            message: "请输入正确的邮箱地址",
            trigger: "blur",
          },
        ],
        password: [],
        status: [{ required: true, message: "请选择状态", trigger: "change" }],
      },
    };
  },
  props: {
    rowitem: {
      default: null,
    },
  },
  created() {

  },
  methods: {
    changeTime(val) {
      console.log('修改val', val);
    },
    //重置表单
    handleReset() {
      this.resetForm("form");
    },

    handleCloseDialog() {
      this.$emit("update:visableIf", false);
    },

    submitForm: function () {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          if (this.form.id != undefined) {
            // editInfo(this.form).then(() => {
            //   this.$modal.msgSuccess('修改成功')
            //   this.handleCloseDialog();
            //   this.$emit('getList');
            // })
          }
        }
      })
    },
  },
};
</script>

<style scoped lang="scss">
.form-item-rows {
  display: flex;
  gap: 6px;
}

::v-deep .el-dialog__footer {
  background:#fafafa;
  border-top: 1px solid #e9e9e9;
}
</style>
